#include <system/syscall.h>
#include <system/types.h>


int syscall_call(uint32_t call, uint32_t ebx, uint32_t ecx, uint32_t edx)
{
	regs_t r;
	uint32_t ret = 0;

	r.eax = call;
	r.ebx = ebx;
	r.ecx = ecx;
	r.edx = edx;
	
	asm("movl %0, %%eax\n\t": : "g" (call));
	asm("movl %0, %%ebx\n\t": : "g" (ebx));
	asm("movl %0, %%ebx\n\t": : "g" (ecx));
	asm("movl %0, %%ebx\n\t": : "g" (edx));
	
	asm ("int %0\n" : : "g" (SYSCALL_INT));

	asm ("movl %%eax, %0\n\t" : "=r" (ret));
	return ret;
}

